home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / Point_Rect C++ Classes / MacObj.sit / MacObj ƒ / CRect.h < prev    next >
Text File  |  1993-09-15  |  2KB  |  70 lines

  1. /*
  2.  CPoint.h
  3.  
  4.         Interface for the Point Class
  5.  
  6. */
  7.  
  8. #pragma once
  9.  
  10. //
  11. // If the symbol _MACOBJ_SPEED is defined, the file CPoint.cp is included by this
  12. // header file and all methods are inlined.  Otherwise, CPoint.cp must be included
  13. // in your project and all methods are called as subroutines.
  14. //
  15.  
  16. #define _MACOBJ_SPEED
  17.  
  18. #include <types.h>
  19. #include <QuickDraw.h>
  20. #include "CPoint.h"
  21.  
  22. class CRect : public Rect
  23. {
  24. public:
  25.     // Constructors
  26.     CRect();
  27.     CRect(short left, short top, short right, short bottom);
  28.     CRect(const Rect& r);
  29.  
  30.     // Member functions
  31.     void SetRect(short left, short top, short right, short bottom);
  32.     void SetRectEmpty();
  33.     void InsetRect(short x, short y);
  34.     void OffsetRect(short x, short y);
  35.     void OffsetRect(Point p);
  36.     Boolean PtInRect(Point p);
  37.     Boolean EmptyRect() const;
  38.     Boolean NullRect() const;
  39.     short Height(void);
  40.     short Width(void);
  41.     Boolean EqualRect(const Rect& r) const;
  42.     CPoint& TopLeft();
  43.     CPoint& BottomRight();
  44.     void UnionRect(Rect& r1, Rect& r2);
  45.     void SectRect(Rect& r1, Rect& r2);
  46.  
  47.     // Quickdraw member functions
  48.     void EraseRect();
  49.     void FillRect(PatPtr thePat);
  50.     void FrameRect();
  51.     void InvertRect();
  52.  
  53.     // Operators
  54.     void operator=(const Rect& r);
  55.     Boolean operator==(const Rect& r) const;
  56.     Boolean operator!=(const Rect& r) const;
  57.     void operator+=(Point p);
  58.     void operator-=(Point p);
  59.     void operator|=(const Rect& r);
  60.     void operator&=(const Rect& r);
  61.     CRect operator+(Point p) const;
  62.     CRect operator-(Point p) const;
  63.     CRect operator|(const Rect& r) const;
  64.     CRect operator&(const Rect& r) const;
  65.     
  66. };
  67.  
  68. #ifdef _MACOBJ_SPEED
  69. #include "CRect.cp"
  70. #endif